﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AoChuan.aspx.cs" Inherits="Trangtrai.cauhinhsanxuat.AoChuan"
    MasterPageFile="~/SiteMaster.Master" %>

<%@ Register Assembly="DevExpress.Web.ASPxEditors.v11.1, Version=11.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v11.1, Version=11.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxTreeList.v11.1, Version=11.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxTreeList" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v11.1, Version=11.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxSiteMapControl" TagPrefix="dx" %>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <center>
        <table width="960px" bgcolor="White">
            <tr>
                <td colspan="3" bgcolor="#94B6EF" align="center">
                    <dx:ASPxLabel ID="ASPxLabel1" runat="server" Text="Khởi tạo ao chuẩn" Font-Bold="false"
                        Font-Size="Large" ForeColor="Black">
                    </dx:ASPxLabel>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <br />
                </td>
            </tr>
            <tr>
                <td class="style4">
                    <table id="smallTable" style="border: thin solid #94B6EF">
                        <tr>
                            <td bgcolor="#94B6EF" align="left">
                                <dx:ASPxLabel ID="ASPxLabel2" runat="server" Text="Tên ao chuẩn">
                                </dx:ASPxLabel>
                            </td>
                            <td>
                                <dx:ASPxTextBox ID="tbxAoChuanCode" runat="server" Width="170px" CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css"
                                    CssPostfix="Office2003Blue" SpriteCssFilePath="~/App_Themes/Office2003Blue/{0}/sprite.css">
                                </dx:ASPxTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <br />
                            </td>
                        </tr>
                        <tr>
                            <td bgcolor="#94B6EF" align="left">
                                <dx:ASPxLabel ID="ASPxLabel3" runat="server" Text="Mã ao chuẩn">
                                </dx:ASPxLabel>
                            </td>
                            <td>
                                <dx:ASPxTextBox ID="tbxAoChuanName" runat="server" Width="170px" CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css"
                                    CssPostfix="Office2003Blue" SpriteCssFilePath="~/App_Themes/Office2003Blue/{0}/sprite.css">
                                </dx:ASPxTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <br />
                            </td>
                        </tr>
                        <tr>
                            <td bgcolor="#94B6EF" align="left">
                                <dx:ASPxLabel ID="ASPxLabel4" runat="server" Text="Mùa vụ">
                                </dx:ASPxLabel>
                            </td>
                            <td>
                                <dx:ASPxComboBox ID="cbxSeason" runat="server" CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css"
                                    CssPostfix="Office2003Blue" SpriteCssFilePath="~/App_Themes/Office2003Blue/{0}/sprite.css"
                                    ValueType="System.String" ValueField="SEASON_NAME" DataSourceID="SqlDataSource2"
                                    TextFormatString="{1}" AutoPostBack="true">
                                    <Columns>
                                        <dx:ListBoxColumn Caption="STT" FieldName="SEASON_ID" />
                                        <dx:ListBoxColumn Caption="Mùa vụ" FieldName="SEASON_NAME" />
                                    </Columns>
                                    <LoadingPanelImage Url="~/App_Themes/Office2003Blue/Web/Loading.gif">
                                    </LoadingPanelImage>
                                </dx:ASPxComboBox>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <br />
                            </td>
                        </tr>
                        <tr>
                            <td bgcolor="#94B6EF" align="left">
                                <dx:ASPxLabel ID="ASPxLabel5" runat="server" Text="Mã ao chọn">
                                </dx:ASPxLabel>
                            </td>
                            <td>
                                <dx:ASPxComboBox ID="cbxAoCode" runat="server" CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css"
                                    CssPostfix="Office2003Blue" SpriteCssFilePath="~/App_Themes/Office2003Blue/{0}/sprite.css"
                                    ValueType="System.String" ValueField="AO_CODE" AutoPostBack="true" DataSourceID="SqlDataSource3"
                                    TextFormatString="{0}">
                                    <Columns>
                                        <dx:ListBoxColumn Caption="Mã ao" FieldName="AO_CODE" />
                                    </Columns>
                                    <LoadingPanelImage Url="~/App_Themes/Office2003Blue/Web/Loading.gif">
                                    </LoadingPanelImage>
                                </dx:ASPxComboBox>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <br />
                            </td>
                        </tr>
                        <tr>
                            <td bgcolor="#94B6EF" align="left">
                                <dx:ASPxLabel ID="ASPxLabel6" runat="server" Text="Tên ao chọn">
                                </dx:ASPxLabel>
                            </td>
                            <td>
                                <dx:ASPxTextBox ID="tbxAoName" runat="server" Width="170px" CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css"
                                    CssPostfix="Office2003Blue" SpriteCssFilePath="~/App_Themes/Office2003Blue/{0}/sprite.css"
                                    ReadOnly="True">
                                </dx:ASPxTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" align="left">
                                <br />
                                <dx:ASPxButton ID="btnAdd" runat="server" CssFilePath="~/App_Themes/SoftOrange/{0}/styles.css"
                                    CssPostfix="SoftOrange" SpriteCssFilePath="~/App_Themes/SoftOrange/{0}/sprite.css"
                                    Text="Thêm" OnClick="btnAdd_Click">
                                </dx:ASPxButton>
                                <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:TOM_MSConnectionString %>"
                                    SelectCommand="SELECT [SEASON_ID], [SEASON_NAME] FROM [SEASON]"></asp:SqlDataSource>
                                <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:TOM_MSConnectionString %>"
                                    SelectCommand="SELECT [AO_CODE] FROM [AO]"></asp:SqlDataSource>
                            </td>
                        </tr>
                    </table>
                </td>
                <td class="style3">
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TOM_MSConnectionString %>"
                        SelectCommand="SELECT AOCHUAN.AOCHUAN_CODE, AOCHUAN.AOCHUAN_NAME, SEASON.SEASON_NAME, SEASON.START_DATE, AO.AO_CODE FROM AOCHUAN INNER JOIN SEASON ON SEASON.SEASON_ID = (SELECT SEASON_ID FROM AO_SEASON WHERE (AO_SEASON_ID = AOCHUAN.AO_SEASON_ID)) INNER JOIN AO ON AOCHUAN.AOCHUAN_ID = AO.AO_ID"
                        ProviderName="<%$ ConnectionStrings:TOM_MSConnectionString.ProviderName %>">
                    </asp:SqlDataSource>
                    <dx:ASPxGridView ID="ASPxGridView1" runat="server" Width="591px" AutoGenerateColumns="False"
                        DataSourceID="SqlDataSource1" KeyFieldName="AoChuanCode" CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css"
                        CssPostfix="Office2003Blue">
                        <Styles CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css" CssPostfix="Office2003Blue">
                            <Header ImageSpacing="5px" SortingImageSpacing="5px">
                            </Header>
                            <LoadingPanel ImageSpacing="10px">
                            </LoadingPanel>
                        </Styles>
                        <SettingsPager>
                            <AllButton Text="All">
                            </AllButton>
                            <NextPageButton Text="Next &gt;">
                            </NextPageButton>
                            <PrevPageButton Text="&lt; Prev">
                            </PrevPageButton>
                        </SettingsPager>
                        <ImagesFilterControl>
                            <LoadingPanel Url="~/App_Themes/Office2003Blue/Editors/Loading.gif">
                            </LoadingPanel>
                        </ImagesFilterControl>
                        <Images SpriteCssFilePath="~/App_Themes/Office2003Blue/{0}/sprite.css">
                            <LoadingPanelOnStatusBar Url="~/App_Themes/Office2003Blue/GridView/gvLoadingOnStatusBar.gif">
                            </LoadingPanelOnStatusBar>
                            <LoadingPanel Url="~/App_Themes/Office2003Blue/GridView/Loading.gif">
                            </LoadingPanel>
                        </Images>
                        <Columns>
                            <dx:GridViewCommandColumn ButtonType="Image" Caption="Xóa" VisibleIndex="6">
                                <DeleteButton Visible="True">
                                    <Image Url="~/Image/delete.PNG">
                                    </Image>
                                </DeleteButton>
                                <ClearFilterButton Visible="True">
                                </ClearFilterButton>
                            </dx:GridViewCommandColumn>
                            <dx:GridViewDataTextColumn Caption="Mã số ao chuẩn" FieldName="AoChuanCode" VisibleIndex="0">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn Caption="Tên ao chuẩn" FieldName="AoChuanName" VisibleIndex="1">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn Caption="Mùa vụ" FieldName="SeasonName" VisibleIndex="2">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataDateColumn Caption="Ngày tháng" FieldName="FromDate" VisibleIndex="3">
                            </dx:GridViewDataDateColumn>
                            <dx:GridViewCommandColumn ButtonType="Image" Caption="Sửa" VisibleIndex="5">
                                <EditButton Visible="True">
                                    <Image Url="~/Image/modify.PNG">
                                    </Image>
                                </EditButton>
                                <CancelButton>
                                    <Image Url="~/Image/delete.PNG">
                                    </Image>
                                </CancelButton>
                                <UpdateButton>
                                    <Image Url="~/Image/save.PNG">
                                    </Image>
                                </UpdateButton>
                                <ClearFilterButton Visible="True">
                                </ClearFilterButton>
                            </dx:GridViewCommandColumn>
                            <dx:GridViewDataTextColumn Caption="Mã ao chọn" FieldName="AoCode" VisibleIndex="4">
                            </dx:GridViewDataTextColumn>
                        </Columns>
                        <Settings ShowFilterRow="True" />
                        <StylesEditors>
                            <ProgressBar Height="25px">
                            </ProgressBar>
                        </StylesEditors>
                        <SettingsEditing Mode="PopupEditForm" PopupEditFormWidth="600px" PopupEditFormHorizontalAlign="Center" />
                    </dx:ASPxGridView>
                    <br />
                </td>
            </tr>
        </table>
    </center>
</asp:Content>
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="head">
    <script type="text/javascript" src="../../js/jquery-latest.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {

            $("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled - Adds empty span tag after ul.subnav

            $("ul.topnav li span").click(function () { //When trigger is clicked...

                //Following events are applied to the subnav itself (moving subnav up and down)
                $(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click

                $(this).parent().hover(function () {
                }, function () {
                    $(this).parent().find("ul.subnav").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
                });
                ;
                //Following events are applied to the trigger (Hover events for the trigger)
            }).hover(function () {
                $(this).addClass("subhover"); //On hover over, add class "subhover"
            }, function () {	//On Hover Out
                $(this).removeClass("subhover"); //On hover out, remove class "subhover"
            });

        });
    </script>
    <style type="text/css">
        .style3
        {
            height: 98px;
        }
        .style4
        {
            width: 359px;
        }
        #smallTable
        {
            width: 341px;
        }
    </style>
</asp:Content>
